package cc.ilzy.mall.api.controller;

import cc.ilzy.mall.model.request.AddressAddRequest;
import cc.ilzy.mall.model.vo.AddressVo;
import cc.ilzy.mall.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "地址相关接口", tags = "地址相关接口")
@RequestMapping("/api/address/v1")
public interface IAddressController {
    @GetMapping("/find/{addressId}")
    ApiResponse<AddressVo> findAddressById(@ApiParam(value = "地址id", required = true) @PathVariable Long addressId);

    @ApiOperation("新增收货地址")
    @PostMapping("/add")
    ApiResponse<Void> add(@ApiParam("收货地址信息") @RequestBody AddressAddRequest addressRequest);

    @ApiOperation("删除收货地址")
    @DeleteMapping("/del/{addressId}")
    ApiResponse<Void> deleteAddress(@ApiParam(value = "地址id", required = true) @PathVariable Long addressId);

    @ApiOperation("查询用户的全部收货地址")
    @GetMapping("/list")
    ApiResponse<List<AddressVo>> listAllAddress();
}
